package com.atguigu.exer2;

import java.util.Iterator;
import java.util.TreeSet;

/**
 * 2.请把学生名与考试分数录入到集合中，并按分数显示前三名
 * 成绩学员的名字。
 */
public class ScoreTest {
    public static void main(String[] args) {
        TreeSet<Student> set = new TreeSet();

        set.add(new Student("Tom", 85, 1001));
        set.add(new Student("Jerry", 95, 1002));
        set.add(new Student("Jon", 60, 1003));
        set.add(new Student("White", 89, 1004));
        set.add(new Student("Black", 60, 1005));

        Iterator iterator = set.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}


